Optimal. Leaf size=314 \[ \frac {1}{8} \left (6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )+4 a^2 \left (2 c^3+3 c d^2\right )\right ) x-\frac {\left (20 a^2 d^2 \left (4 c^2+d^2\right )+30 a b c d \left (c^2+4 d^2\right )-b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 314, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2870, 2832,
2813} \begin {gather*} -\frac {\left (20 a^2 d^2 \left (4 c^2+d^2\right )+30 a b c d \left (c^2+4 d^2\right )-\left (b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-\left (b^2 \left (6 c^3-71 c d^2\right )\right )\right ) \sin (e+f x) \cos (e+f x)}{120 f}+\frac {1}{8} x \left (4 a^2 \left (2 c^3+3 c d^2\right )+6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )\right )-\frac {\left (4 d^2 \left (5 a^2+4 b^2\right )-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2832
Rule 2870
Rubi steps
\begin {align*} \int (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx &=-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x))^3 \left (\left (5 a^2+4 b^2\right ) d-b (b c-10 a d) \sin (e+f x)\right ) \, dx}{5 d}\\ &=\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x))^2 \left (d \left (20 a^2 c+13 b^2 c+30 a b d\right )+\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \sin (e+f x)\right ) \, dx}{20 d}\\ &=-\frac {\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x)) \left (d \left (150 a b c d+20 a^2 \left (3 c^2+2 d^2\right )+b^2 \left (33 c^2+32 d^2\right )\right )+\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \sin (e+f x)\right ) \, dx}{60 d}\\ &=\frac {1}{8} \left (6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )+4 a^2 \left (2 c^3+3 c d^2\right )\right ) x-\frac {\left (20 a^2 d^2 \left (4 c^2+d^2\right )+30 a b c d \left (c^2+4 d^2\right )-b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.46, size = 249, normalized size = 0.79 \begin {gather*} \frac {-60 \left (b^2 d \left (18 c^2+5 d^2\right )+4 a b c \left (4 c^2+9 d^2\right )+6 a^2 \left (4 c^2 d+d^3\right )\right ) \cos (e+f x)+10 d \left (24 a b c d+4 a^2 d^2+b^2 \left (12 c^2+5 d^2\right )\right ) \cos (3 (e+f x))-6 b^2 d^3 \cos (5 (e+f x))+15 \left (4 \left (6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )+4 a^2 \left (2 c^3+3 c d^2\right )\right ) (e+f x)-8 \left (3 a^2 c d^2+2 a b d \left (3 c^2+d^2\right )+b^2 \left (c^3+3 c d^2\right )\right ) \sin (2 (e+f x))+b d^2 (3 b c+2 a d) \sin (4 (e+f x))\right )}{480 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.43, size = 325, normalized size = 1.04 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 338, normalized size = 1.08 \begin {gather*} \frac {480 \, {\left (f x + e\right )} a^{2} c^{3} + 120 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c^{3} + 720 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b c^{2} d + 480 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} c^{2} d + 360 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c d^{2} + 960 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a b c d^{2} + 45 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c d^{2} + 160 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} d^{3} + 30 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a b d^{3} - 32 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} b^{2} d^{3} - 960 \, a b c^{3} \cos \left (f x + e\right ) - 1440 \, a^{2} c^{2} d \cos \left (f x + e\right )}{480 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 253, normalized size = 0.81 \begin {gather*} -\frac {24 \, b^{2} d^{3} \cos \left (f x + e\right )^{5} - 40 \, {\left (3 \, b^{2} c^{2} d + 6 \, a b c d^{2} + {\left (a^{2} + 2 \, b^{2}\right )} d^{3}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left (24 \, a b c^{2} d + 6 \, a b d^{3} + 4 \, {\left (2 \, a^{2} + b^{2}\right )} c^{3} + 3 \, {\left (4 \, a^{2} + 3 \, b^{2}\right )} c d^{2}\right )} f x + 120 \, {\left (2 \, a b c^{3} + 6 \, a b c d^{2} + 3 \, {\left (a^{2} + b^{2}\right )} c^{2} d + {\left (a^{2} + b^{2}\right )} d^{3}\right )} \cos \left (f x + e\right ) - 15 \, {\left (2 \, {\left (3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \cos \left (f x + e\right )^{3} - {\left (4 \, b^{2} c^{3} + 24 \, a b c^{2} d + 10 \, a b d^{3} + 3 \, {\left (4 \, a^{2} + 5 \, b^{2}\right )} c d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{120 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 729 vs.
\(2 (292) = 584\).
time = 0.48, size = 729, normalized size = 2.32 \begin {gather*} \begin {cases} a^{2} c^{3} x - \frac {3 a^{2} c^{2} d \cos {\left (e + f x \right )}}{f} + \frac {3 a^{2} c d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a^{2} c d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a^{2} c d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {a^{2} d^{3} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} d^{3} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {2 a b c^{3} \cos {\left (e + f x \right )}}{f} + 3 a b c^{2} d x \sin ^{2}{\left (e + f x \right )} + 3 a b c^{2} d x \cos ^{2}{\left (e + f x \right )} - \frac {3 a b c^{2} d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {6 a b c d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 a b c d^{2} \cos ^{3}{\left (e + f x \right )}}{f} + \frac {3 a b d^{3} x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {3 a b d^{3} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {3 a b d^{3} x \cos ^{4}{\left (e + f x \right )}}{4} - \frac {5 a b d^{3} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {3 a b d^{3} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} + \frac {b^{2} c^{3} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c^{3} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c^{3} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {3 b^{2} c^{2} d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{2} c^{2} d \cos ^{3}{\left (e + f x \right )}}{f} + \frac {9 b^{2} c d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {9 b^{2} c d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {9 b^{2} c d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {15 b^{2} c d^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {9 b^{2} c d^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {b^{2} d^{3} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 b^{2} d^{3} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {8 b^{2} d^{3} \cos ^{5}{\left (e + f x \right )}}{15 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{2} \left (c + d \sin {\left (e \right )}\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 274, normalized size = 0.87 \begin {gather*} -\frac {b^{2} d^{3} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {1}{8} \, {\left (8 \, a^{2} c^{3} + 4 \, b^{2} c^{3} + 24 \, a b c^{2} d + 12 \, a^{2} c d^{2} + 9 \, b^{2} c d^{2} + 6 \, a b d^{3}\right )} x + \frac {{\left (12 \, b^{2} c^{2} d + 24 \, a b c d^{2} + 4 \, a^{2} d^{3} + 5 \, b^{2} d^{3}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (16 \, a b c^{3} + 24 \, a^{2} c^{2} d + 18 \, b^{2} c^{2} d + 36 \, a b c d^{2} + 6 \, a^{2} d^{3} + 5 \, b^{2} d^{3}\right )} \cos \left (f x + e\right )}{8 \, f} + \frac {{\left (3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {{\left (b^{2} c^{3} + 6 \, a b c^{2} d + 3 \, a^{2} c d^{2} + 3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.44, size = 358, normalized size = 1.14 \begin {gather*} -\frac {90\,a^2\,d^3\,\cos \left (e+f\,x\right )+75\,b^2\,d^3\,\cos \left (e+f\,x\right )-10\,a^2\,d^3\,\cos \left (3\,e+3\,f\,x\right )-\frac {25\,b^2\,d^3\,\cos \left (3\,e+3\,f\,x\right )}{2}+\frac {3\,b^2\,d^3\,\cos \left (5\,e+5\,f\,x\right )}{2}+30\,b^2\,c^3\,\sin \left (2\,e+2\,f\,x\right )-30\,b^2\,c^2\,d\,\cos \left (3\,e+3\,f\,x\right )+90\,a^2\,c\,d^2\,\sin \left (2\,e+2\,f\,x\right )+90\,b^2\,c\,d^2\,\sin \left (2\,e+2\,f\,x\right )-\frac {45\,b^2\,c\,d^2\,\sin \left (4\,e+4\,f\,x\right )}{4}+240\,a\,b\,c^3\,\cos \left (e+f\,x\right )+360\,a^2\,c^2\,d\,\cos \left (e+f\,x\right )+270\,b^2\,c^2\,d\,\cos \left (e+f\,x\right )+60\,a\,b\,d^3\,\sin \left (2\,e+2\,f\,x\right )-\frac {15\,a\,b\,d^3\,\sin \left (4\,e+4\,f\,x\right )}{2}-120\,a^2\,c^3\,f\,x-60\,b^2\,c^3\,f\,x-60\,a\,b\,c\,d^2\,\cos \left (3\,e+3\,f\,x\right )+180\,a\,b\,c^2\,d\,\sin \left (2\,e+2\,f\,x\right )-180\,a^2\,c\,d^2\,f\,x-135\,b^2\,c\,d^2\,f\,x+540\,a\,b\,c\,d^2\,\cos \left (e+f\,x\right )-90\,a\,b\,d^3\,f\,x-360\,a\,b\,c^2\,d\,f\,x}{120\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________